<template>
    <div>
        <table>
            <thead>
                <tr>
                    <td>等级名称</td>
                    <td>等级状态</td>
                    <td>启用/禁用</td>
                    <td>创建时间</td>
                </tr>
            </thead>
            <tbody>
                <tr v-for="m in data ">
                    <td>{{m.djmc}}</td>
                    <td>{{m.djzt}}</td>
                    <td>{{m.qy}}</td>
                    <td>{{m.cjsj}}</td>
                    <td>
                    <input type="button" value="删除" @click="sc(m.id)">

                    </td>
                
                </tr>
            </tbody>
        </table>

    </div>
</template>

<script setup lang="ts">
import axios from 'axios';
import { ref,onMounted } from 'vue';

const data=ref([{
    "id": 0,
  "djmc": "string",
  "djzt": "string",
  "qy": true,
  "cjsj": "2025-03-23T11:53:21.769Z"
}])

onMounted(()=>{
    xs();
})

const xs=()=>{
    axios.get("https://localhost:7261/api/we/xs").then(res=>{
      data.value=res.data
    })
}
const sc=(a:any)=>{
    if(confirm("确认删除吗"))
    debugger
    axios.get("https://localhost:7261/api/we/dele",{params:{id:a}}).then(res=>{
          if(res.data>0){
            alert("删除成功")
            xs();
          }else{
            alert("删除失败")
          }
    })
}
</script>

<style scoped>

</style>